package com.tony.blog.model.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tony.blog.model.entity.SysUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

/**
 * Created with IntelliJ IDEA.
 *
 * @Title: SysUserMapper
 * @Auther: 皮蛋布丁
 * @Date: 2021/08/12/14:22
 * @Description:
 */
@Mapper
public interface SysUserMapper  extends BaseMapper<SysUserEntity> {

    /**
     * @Description: queryAllperms 根据userId获取用户的所有权限
     * @Param: [userId]
     * @return: java.util.List<java.lang.String>
     * @Author: 皮蛋布丁
     * @Date: 2021/7/28 17:34
     */
    List<String> queryAllperms(Long userId);

    /**
     * @Description: queryDeptIdsByUserId 根据userId获取分配给用户的部门数据权限id列表
     * @Param: [userId]
     * @return: java.util.Set<java.lang.Long>
     * @Author: 皮蛋布丁
     * @Date: 2021/7/29 14:53
     */
    Set<Long> queryDeptIdsByUserId(Long userId);

    /**
     * @Description: queryAllMenuId 查询用户的所有权限
     * @Param: [userId]
     * @return: java.util.List<java.lang.Long>
     * @Author: 皮蛋布丁
     * @Date: 2021/8/1 15:51
     */
    List<Long> queryAllMenuId(Long userId);

    /**
    * @Description: updateUserImg 修改用户头像
    * @Param: [userId, imgUrl]
    * @return: java.lang.Integer
    * @Author: 皮蛋布丁
    * @Date: 2021/9/28 17:23
    */
    Integer updateUserImg(@Param("userId") Long userId,@Param("imgUrl") String imgUrl);
}
